package br.com.dufs.mvc.model;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.validation.constraints.NotNull;
import org.hibernate.validator.constraints.Email;
import com.fscoreunipe.app.infra.annotations.CPF;
import com.fscoreunipe.app.infra.annotations.Create_AT;

@Create_AT
@Entity
public class Pessoa implements Serializable {

		private static final long serialVersionUID = 1L;

		@Id
		private String idPesoa;

		@NotNull
		@Column
		private String nome;

		@Email
		@Column
		private String email;

		@CPF
		@Column
		private String cpf;

		public Pessoa() {
		}

		public Pessoa(String idPesoa) {
			super();
			this.idPesoa = idPesoa;
		}

		public String getIdPesoa() {
			return idPesoa;
		}

		public void setIdPesoa(String idPesoa) {
			this.idPesoa = idPesoa;
		}

		public String getNome() {
			return nome;
		}
		public void setNome(String nome) {
			this.nome = nome;
		}

		public String getEmail() {
			return email;
		}
		public void setEmail(String email) {
			this.email = email;
		}

		public String getCpf() {
			return cpf;
		}

		public void setCpf(String cpf) {
			this.cpf = cpf;
		}
		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + ((idPesoa == null) ? 0 : idPesoa.hashCode());
			return result;
		}

		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (getClass() != obj.getClass())
				return false;
			Pessoa other = (Pessoa) obj;
			if (idPesoa == null) {
				if (other.idPesoa != null)
					return false;
			} else if (!idPesoa.equals(other.idPesoa))
				return false;
			return true;
		}

		@Override
		public String toString() {
			return "Pessoa [idPesoa=" + idPesoa + "]";
		}
}